<!doctype html>
<html lang="en">
{% load static %}
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>登录</title>
    <script src="{% static 'bl/js/jQuery.js' %}"></script>
    <link rel="stylesheet" href="https://at.alicdn.com/t/font_850328_4weqx76q6s5.css">
    <link rel="stylesheet" href="{% static 'bl/css/login.css' %}">
</head>
<body>
    <div class="fixed"></div>
    <!--<div class="gray"></div>-->
    <div class="head">
        <div class="center">
            <div class="top"></div>
            <h3>Welcome</h3>
        </div>
    </div>

    <div class="con">
        <h1>用户名或邮箱</h1>
        <input type="text" name="username">
        <h1>密码</h1>
        <input type="password" name="password">
        <div class="word">
            <input type="checkbox" name="remember" class="checkbox">
            记住我（请在私人计算机上使用）
        </div>
        <a href="javascript:;"><button onclick="btn()">登录</button></a>
        <a href="zhuce.html"><button class="button">注册</button></a>
        <div class="denglu">
            <div class="left">其他方式登录：</div>
            <ul>
                <li>
                    <i class="iconfont icon-qq"></i>

                </li>
                <li>
                    <i class="iconfont icon-ai-weixin"></i>
                </li>
                <li>
                    <i class="iconfont icon-weibo"></i>
                </li>
        </div>
    </div>

    <!--<div class="wrapper">-->
        <!--<svg id="header-decor" class="decor bottom" xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 100 100" preserveAspectRatio="none">-->
            <!--<path class="large left" d="M0 0 L50 50 L0 100" fill="rgba(255,255,255, .1)"></path>-->
            <!--<path class="large right" d="M100 0 L50 50 L100 100" fill="rgba(255,255,255, .1)"></path>-->
            <!--<path class="medium left" d="M0 100 L50 50 L0 33.3" fill="rgba(255,255,255, .3)"></path>-->
            <!--<path class="medium right" d="M100 100 L50 50 L100 33.3" fill="rgba(255,255,255, .3)"></path>-->
            <!--<path class="small left" d="M0 100 L50 50 L0 66.6" fill="rgba(255,255,255, .5)"></path>-->
            <!--<path class="small right" d="M100 100 L50 50 L100 66.6" fill="rgba(255,255,255, .5)"></path>-->
            <!--<path d="M0 99.9 L50 49.9 L100 99.9 L0 99.9" fill="rgba(255,255,255, 1)"></path>-->
            <!--<path d="M48 52 L50 49 L52 52 L48 52" fill="rgba(255,255,255, 1)"></path>-->
        <!--</svg>-->
    <!--</div>-->
    <!--<div class="wrapper wrapper1">-->
        <!--<svg id="header-decor" class="decor bottom" xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 100 100" preserveAspectRatio="none">-->
            <!--<path class="large left" d="M0 0 L50 50 L0 100" fill="rgba(255,255,255, .1)"></path>-->
            <!--<path class="large right" d="M100 0 L50 50 L100 100" fill="rgba(255,255,255, .1)"></path>-->
            <!--<path class="medium left" d="M0 100 L50 50 L0 33.3" fill="rgba(255,255,255, .3)"></path>-->
            <!--<path class="medium right" d="M100 100 L50 50 L100 33.3" fill="rgba(255,255,255, .3)"></path>-->
            <!--<path class="small left" d="M0 100 L50 50 L0 66.6" fill="rgba(255,255,255, .5)"></path>-->
            <!--<path class="small right" d="M100 100 L50 50 L100 66.6" fill="rgba(255,255,255, .5)"></path>-->
            <!--<path d="M0 99.9 L50 49.9 L100 99.9 L0 99.9" fill="rgba(255,255,255, 1)"></path>-->
            <!--<path d="M48 52 L50 49 L52 52 L48 52" fill="rgba(255,255,255, 1)"></path>-->
        <!--</svg>-->
    <!--</div>-->
<script src="{% static 'bl/js/index.js'%}"></script>
</body>

<script>

function btn(){

    username = $("[name=username]").val()
    password = $("[name=password]").val()
    remember = $("[name=remember]").val()
    console.log(username,password)
    if(username!="" && password!=""){
        $.ajax({
            url:"/blog/login_check/",
            type:"post",
            contentType: "application/json; charset=utf-8",
            data:JSON.stringify({'username':username,'password':password, 'remember':remember}),
            success:function(data){
                if(data.res == 1){
                    location.href = "../"
                }else{
                      $("[name=username]").text('用户名或密码错误').show()
                  }
            }

        })
    }

}

</script>
</html>
